package sample.controller.model;

import java.io.Serializable;

import org.slim3.datastore.Attribute;
import org.slim3.datastore.Model;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;

@Model
public class Category implements Serializable {

    private static final long serialVersionUID = 1L;
    
    @Attribute(primaryKey = true)
    private Key key;
    
    private String name;
    
    public Key getKey() {
        return key;
    }

    public void setKey(Key key) {
        this.key = key;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getStringKey() {
        return KeyFactory.keyToString(key);
    }
}
